using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Globalization;

public partial class _Default : System.Web.UI.Page 
{
    protected void Page_Load(object sender, EventArgs e)
    {
    }

    protected void btnDownload_Click(object sender, EventArgs e)
    {
        downloadJargon();
    }

    private void downloadJargon()
    {
        Response.Clear();
        Response.ClearHeaders();

        string output = string.Empty, filename = "indir/";
        switch (rdListDownloadType.SelectedValue)
        {
            case "source":
                filename += "src/c_sharp/jargon_src.rar";
                Response.WriteFile(filename);
                Response.ContentType = System.Net.Mime.MediaTypeNames.Application.Octet;
                break;
            case "binary":
                filename += "bin/c_sharp/jargon_bin.rar";
                Response.WriteFile(filename);
                Response.ContentType = System.Net.Mime.MediaTypeNames.Application.Octet;
                break;
        }

        Response.AddHeader("content-disposition", string.Format("attachment;filename={0}", filename));
        Response.End();
    }
}
